home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1999 #3 / Amiga Plus CD - 1999 - No. 3.iso / System / delitracker_ii / developer / examples / fred.s < prev    next >
Text File  |  1994-04-16  |  3KB  |  155 lines

  1.  
  2.     incdir    "Includes:"
  3.     include    "misc/DeliPlayer.i"
  4.  
  5. ;
  6. ;
  7.     SECTION Player,Code
  8. ;
  9. ;
  10.  
  11.     PLAYERHEADER PlayerTagArray
  12.  
  13.     dc.b '$VER: Fred player module V1.5 (15 Mar 94)',0
  14.     even
  15.  
  16. PlayerTagArray
  17.     dc.l    DTP_RequestDTVersion,16
  18.     dc.l    DTP_PlayerVersion,01<<16+50
  19.     dc.l    DTP_PlayerName,PName
  20.     dc.l    DTP_Creator,CName
  21.     dc.l    DTP_Check2,Chk
  22.     dc.l    DTP_Interrupt,Int
  23.     dc.l    DTP_SubSongRange,SubSong
  24.     dc.l    DTP_InitPlayer,InitPlay
  25.     dc.l    DTP_EndPlayer,EndPlay
  26.     dc.l    DTP_InitSound,InitSnd
  27.     dc.l    DTP_EndSound,RemSnd
  28.     dc.l    TAG_DONE
  29.  
  30. *-----------------------------------------------------------------------*
  31. ;
  32. ; Player/Creatorname und lokale Daten
  33.  
  34. PName    dc.b 'FredMonitor',0
  35. CName    dc.b 'Frederic Hahn,',10
  36.     dc.b 'adapted by Turbo/Infect & Delirium',0
  37.     even
  38. fr_data        dc.l 0
  39.  
  40. MaxSong        dc.w 0
  41. MaxSong2    dc.w 0
  42.  
  43. *-----------------------------------------------------------------------*
  44. ;
  45. ;Interrupt für Replay
  46.  
  47. Int
  48.     movem.l    d2-d7/a2-a6,-(sp)
  49.     move.l    fr_data(pc),a0
  50.     jsr    4(a0)                ; DudelDiDum
  51.     movem.l    (sp)+,d2-d7/a2-a6
  52.     rts
  53.  
  54. *-----------------------------------------------------------------------*
  55. ;
  56. ; Testet auf Fred-Modul
  57.  
  58. Chk                        ; Fred ?
  59.     move.l    dtg_ChkData(a5),a0
  60.     moveq    #-1,d0                ; Modul nicht erkannt (default)
  61.     cmpi.w    #$4efa,$00(a0)
  62.     bne.s    ChkEnd
  63.     cmpi.w    #$4efa,$04(a0)
  64.     bne.s    ChkEnd
  65.     cmpi.w    #$4efa,$08(a0)
  66.     bne.s    ChkEnd
  67.     cmpi.w    #$4efa,$0c(a0)
  68.     bne.s    ChkEnd
  69.     add.w    2(a0),a0
  70.     moveq    #4-1,d1
  71. ChkLoop    cmpi.w    #$123a,2(a0)
  72.     bne.s    ChkNext
  73.     cmpi.w    #$b001,6(a0)
  74.     beq.s    ChkSong
  75. ChkNext    addq.l    #2,a0
  76.     dbra    d1,ChkLoop
  77.     bra.s    ChkEnd                ; Modul nicht erkannt
  78. ChkSong    add.w    4(a0),a0
  79.     moveq    #0,d1
  80.     move.b    4(a0),d1
  81.     move.w    d1,MaxSong2
  82.     moveq    #0,d0                ; Modul erkannt
  83. ChkEnd
  84.     rts
  85.  
  86. *-----------------------------------------------------------------------*
  87. ;
  88. ; Set min. & max. subsong number
  89.  
  90. SubSong
  91.     moveq    #0,d0                ; min.
  92.     move.w    MaxSong(pc),d1            ; max.
  93.     rts
  94.  
  95. *-----------------------------------------------------------------------*
  96.  
  97. ; Init Player
  98.  
  99. InitPlay
  100.     moveq    #0,d0
  101.     move.l    dtg_GetListData(a5),a0        ; Function
  102.     jsr    (a0)
  103.     move.l    a0,fr_data
  104.  
  105.     move.w    MaxSong2(pc),MaxSong        ; copy buffer
  106.  
  107.     move.l    dtg_AudioAlloc(a5),a0        ; Function
  108.     jsr    (a0)                ; returncode is already set !
  109.     rts
  110.  
  111. *-----------------------------------------------------------------------*
  112. ;
  113. ; End Player
  114.  
  115. EndPlay
  116.     move.l    dtg_AudioFree(a5),a0        ; Function
  117.     jsr    (a0)
  118.     rts
  119.  
  120. *-----------------------------------------------------------------------*
  121.  
  122. ; Init Sound
  123.  
  124. InitSnd
  125.     move.l    a5,-(sp)
  126.     moveq    #0,d0
  127.     move.w    dtg_SndNum(a5),d0        ; SoundNumber
  128.     move.l    fr_data(pc),a0
  129.     jsr    (a0)                ; Init Sound
  130.     move.l    (sp)+,a5
  131.     rts
  132.  
  133. *-----------------------------------------------------------------------*
  134. ;
  135. ; Remove Sound
  136.  
  137. RemSnd
  138.     move.l    a5,-(sp)
  139.     moveq    #0,d1
  140.     move.l    fr_data(pc),a0
  141.     jsr    8(a0)                ; End Sound
  142.     move.l    (sp)+,a5
  143.  
  144.     moveq    #0,d0
  145.     lea    $dff000,a0
  146.     move.w    d0,$a8(a0)
  147.     move.w    d0,$b8(a0)
  148.     move.w    d0,$c8(a0)
  149.     move.w    d0,$d8(a0)
  150.     move.w    #$f,$96(a0)
  151.     rts
  152.  
  153. *-----------------------------------------------------------------------*
  154.  
  155.